﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MCPlatform.Shared.Components
{
    public class Environments
    {
        public static string AppDataPath
        {
            get
            {
                if (string.IsNullOrEmpty(_appDataPath))
                {
                    _appDataPath = Environment.ExpandEnvironmentVariables(Fields.AppDataPath);
                }

                if (!Directory.Exists(_appDataPath))
                {
                    Directory.CreateDirectory(_appDataPath);
                }

                return _appDataPath;
            }
        }

        private static string? _appDataPath;

        public static string LogFilePath
        {
            get
            {
                if (string.IsNullOrEmpty(_logFilePath))
                {
                    _logFilePath = Path.Combine(AppDataPath, Fields.LogFileName);
                }

                return _logFilePath;
            }
        }

        private static string? _logFilePath;


        public static string MotionCofigPath
        {
            get
            {
                if (string.IsNullOrEmpty(_MotionCofigPath))
                {
                    _MotionCofigPath = Fields.MotionConfigPath;
                }

                return _MotionCofigPath;
            }
        }

        private static string? _MotionCofigPath;
    }
}
